﻿using System;
using System.Globalization;

namespace LayeredArchitectureSample.Infrastructure
{
    public static class StringExtensions
    {
        public static string FormatWith(this string formatString, params object[] formattingArguments)
        {
            return String.Format(CultureInfo.CurrentCulture, formatString, formattingArguments);
        }

        public static string MakeFirstLetterLowercase(this string someString)
        {
            if (someString == null) throw new ArgumentNullException("someString");

            if (someString == String.Empty)
            {
                return someString;
            }

            char[] stringContents = someString.ToCharArray();

            stringContents[0] = Char.ToLower(stringContents[0]);

            return new string(stringContents);
        }
    }
}